package languageacquisition.ontology;

import jade.content.Predicate;

public class HasState implements Predicate{
	private static final long serialVersionUID = -639941485426194985L;
	private int time;
	private EnvObject object;
	private State state;

	public EnvObject getObject() {
		return object;
	}

	public void setObject(EnvObject object) {
		this.object = object;
	}

	public State getState() {
		return state;
	}

	public void setState(State state) {
		this.state = state;
	}

	public int getTime() {
		return time;
	}

	public void setTime(int time) {
		this.time = time;
	}
	public String toString(){
		return "time: " + Integer.toString(getTime()) + ", state: " + getState().getProperties();
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((object == null) ? 0 : object.hashCode());
		result = prime * result + ((state == null) ? 0 : state.hashCode());
		result = prime * result + time;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		HasState other = (HasState) obj;
		if (object == null) {
			if (other.object != null)
				return false;
		} else if (!object.equals(other.object))
			return false;
		if (state == null) {
			if (other.state != null)
				return false;
		} else if (!state.equals(other.state))
			return false;
		if (time != other.time)
			return false;
		return true;
	}
}
